/**
 *导入axios
 */
import request from '@/utils/index'

/**
 *登录请求
 */
export const login = loginForm => {
  return request({
    method: 'POST',
    url: '/app/v1_0/authorizations',
    data: loginForm
  })
}

/**
 *手机验证码请求
 */
export const loginSMS = mobileNum => {
  return request({
    method: 'GET',
    url: `/app/v1_0/sms/codes/${mobileNum}`
  })
}

/**
 * 获取用户个人信息请求
 */
export const getUserInfo = () => {
  return request({
    method: 'GET',
    url: '/app/v1_0/user'
  })
}

/**
 *获取当前用户频道列表
 */
export const getUserChannels = () => {
  return request({
    method: 'GET',
    url: '/app/v1_0/user/channels'
  })
}

/**
 *封装添加用户频道的请求
 */
export const addUserChannels = channels => {
  return request({
    method: 'PATCH',
    url: '/app/v1_0/user/channels',
    data: { channels }
  })
}

/**
 *封装删除用户频道的请求
 */
export const removeUserChannels = channelID => {
  return request({
    method: 'DELETE',
    url: `/app/v1_0/user/channels/${channelID}`
  })
}

/**
 *添加关注的请求
 */
export const addFollowAuthor = target => {
  return request({
    method: 'POST',
    url: ''
  })
}
